package com.wx.stringbuffer_;

import com.sun.xml.internal.stream.StaxErrorReporter;

/**
 * @Author : 佩萁
 * Description :
 * @Create : 2023/7/12 - 23:06
 */
public class StringAndStringBuffer {
    public static void main(String[] args) {
        //String --> StringBuffer
        String str = "hello tom";
        StringBuffer stringBuffer = new StringBuffer(str);
        StringBuffer stringBuffer1 = new StringBuffer().append(str);

        StringBuffer stringBuffer2 = new StringBuffer("韩顺平教育");
        String s = stringBuffer2.toString();
        String s1 = new String(stringBuffer2);
        System.out.println(stringBuffer1);
        System.out.println(s1);
    }
}
